<template>
    <div id="">
      <p><img :src="imgs[nums]"></p>
      <p><button type="button" @click="right()">上一张</button>
      <button type="button" @click="left()">下一张</button>
      </p>
    </div>
</template>

<script>
    export default {
      name: "PageText",
      data() {
        return {
          nums:0,
          imgs:['./static/002.png', './static/003.png', './static/004.png', './static/005.png', './static/006.png']
      }
      },
      methods:{
        'right':function () {
          this.nums--;
          if(this.nums<0){
            this.nums=this.imgs.length-1;
          }

        },
        'left':function () {
          this.nums++;
          if(this.nums>this.imgs.length-1){
            this.nums=0;
          }

        }
      }
    }
</script>

<style scoped>

</style>
